#pragma once
#include "GePoint3.h"
#include "GePoint2.h"
#include "GeBoundBox3.h"
#include "GeMatrix3.h"
#define EXP_API __declspec(dllexport)
namespace ds3
{
	using namespace tge;
#pragma pack(push,2)
	struct EXP_API MeshVertex
	{
		float tex[2];
		float nor[3];
		float vert[3];
	public:
		GeVector3f&normal();
		GePoint3f&vertex();
		MeshVertex&setNormal(const GeVector3f&nor);
		MeshVertex&set(const GePoint3f&pt,const GeVector3f&nor,const GeVector2f&uv);
	};
	struct EXP_API MeshTriFace
	{
		WORD vert[3];
	};
#pragma pack(pop)
	class EXP_API decMesh3
	{
	public:
		GeBoundBox3d m_bbox;
		std::vector<MeshVertex>m_arrVert;
		std::vector<MeshVertex>m_arrVert2;
		std::vector<MeshTriFace>m_arrFace;
	public:
		decMesh3(void);
		~decMesh3(void);
		void checkUpdate();
		bool isValidShape()const;
		const GeBoundBox3d&getBoundBox()const;
		decMesh3&transformBy(const GeMatrix3d&tm);
		void setSmoothGroup(int num,const DWORD*arrGroup);
		int countFace()const;
		int countVertices()const;
		void computeBoundBox();
	};
}
